import numpy as np
"""
basic relu layer
input must be ndarray
"""
class ReLU:
    def __init__(self):
        self.x = None

    def __call__(self, x):
        self.x = x
        return (x > 0) * x

    def backward(self, dout):
        return dout * (self.x > 0)